#pragma once

#include "ExcepBase.h"

namespace tinytool
{
namespace touch
{

#define THROW_EXCEP_TOUCH_IF(expr, msg)                   \
    do {                                                  \
        if ((expr)) {                                     \
            std::ostringstream oss;                       \
            oss << HTF_ERROR_WHERE << msg;                \
            throw tinytool::touch::ExcepTouch{oss.str()}; \
        }                                                 \
    } while (0)

class ExcepTouch : public ExcepBase
{
public:
    ExcepTouch(const std::string& what)
        : ExcepBase{"touch-error: " + what} {}
    ~ExcepTouch() = default;
};

}   // namespace touch
}   // namespace tinytool